fix(ci): always run release cleanup on failure#153
Conversation
The "Cleanup on failure" step in npm-publish.yml was gated on `failure() && steps.create_release.outcome == 'success'`, so if `gh release create` itself failed, cleanup was skipped and the bumped commit/tag were left pushed with no npm/GitHub release. Drop the create_release gate (`if: failure()`) and add `|| true` to the cleanup commands so one missing artifact doesn't abort the rest. Same fix as humanspeak/svelte-purify (CodeRabbit finding). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 5 minutes and 48 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
Comment |
|
❌ Release workflow failed. Please check the workflow logs |
Problem
In
.github/workflows/npm-publish.yml, the Cleanup on failure step is gated on:The version-bump step pushes the commit and tag before the release step runs. If
gh release createitself fails, this cleanup is skipped (its condition requirescreate_releaseto have succeeded), so the branch/tag are left ahead of npm/GitHub Releases — a partial-release state that needs manual repair.Fix
if: failure()ensures cleanup always runs when the job fails, including whengh release createis the thing that failed.|| trueguards keep one already-missing artifact (e.g. a release that never got created) from aborting the remaining cleanup commands.Context
Originally flagged by CodeRabbit on
humanspeak/svelte-purify#56and fixed there. This same templated workflow carries the bug across the org; this PR applies the identical fix here. Verified the change is exactly the condition line plus the three cleanup commands — no other changes.🤖 Generated with Claude Code